/*
* jlb
*/
package com.jlb.miner.entity;

/**
 * 矿机 的实体类的状态
 * 状态：待上架 Audit，销售中 Sales，已售罄 Sell_Out,已下架 Withdraw
 *
 * @author jlb
 */
public enum MinerItemState implements java.io.Serializable {
    Audit("待上架"),
    Sales("销售中"),
    Sell_Out("已售罄"),
    Withdraw("已下架"),;


    public String val;

    MinerItemState(String val) {
        this.val = val;
    }

    /**
     * 根据状态名称查询状态
     *
     * @param stateName
     * @return
     */
    public static MinerItemState getEnum(String stateName) {
        for (MinerItemState minerItemState : MinerItemState.values()) {
            if (minerItemState.name().equalsIgnoreCase(stateName)) {
                return minerItemState;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }

}
